var API = require('../../utils/api/index.js')
Page({
  data: {
    imgUrls: []
  },
  onLoad: function (options) {
    var that = this;
    const imgUrls = []
    API.ajax('', function (res) {
      for(var i = 0;i<res.data.length;i++){
        imgUrls.push(res.data[i].img)
      }

      that.setData({
        imgUrls: imgUrls
      })
      console.log(that.data.imgUrls);
    })
  },
  changeIndicatorDots(e) {
    this.setData({
      indicatorDots: !this.data.indicatorDots
    })
  },
  changeAutoplay(e) {
    this.setData({
      autoplay: !this.data.autoplay
    })
  },
  errLog(e){
    console.log(e)
  },
  intervalChange(e) {
    this.setData({
      interval: e.detail.value
    })
  },
  durationChange(e) {
    this.setData({
      duration: e.detail.value
    })
  },
  bindOrder(e) {
    wx.navigateTo({
      url: '../menu/index'
    })
  }
})